package com.whmskj.xjlhsc.mobie.empProPlan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.whmskj.xjlhsc.mobie.empProPlan.entity.ProPersonnelStandMachine;
import com.whmskj.xjlhsc.mobie.empProPlan.mapper.ProPersonnelStandMachineMapper;
import com.whmskj.xjlhsc.mobie.empProPlan.service.ProPersonnelStandMachineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import java.util.List;

/**
 * @author lk
 * @since 2025-07-07 11:22:42
 */
@Service
@Slf4j
public class ProPersonnelStandMachineServiceImpl extends ServiceImpl<ProPersonnelStandMachineMapper, ProPersonnelStandMachine> implements ProPersonnelStandMachineService {

    @Autowired
    private ProPersonnelStandMachineMapper proPersonnelStandMachineMapper;

    @Override
    public Page<ProPersonnelStandMachine> findPage(ProPersonnelStandMachine params) {
        Page<ProPersonnelStandMachine> page = new Page<>(1, 10);//TODO 自行处理
        LambdaQueryWrapper<ProPersonnelStandMachine> query = Wrappers.lambdaQuery(ProPersonnelStandMachine.class);
        return proPersonnelStandMachineMapper.selectPage(page, query);
    }

    @Override
    public List<ProPersonnelStandMachine> findList(ProPersonnelStandMachine params){
        LambdaQueryWrapper<ProPersonnelStandMachine> query = Wrappers.lambdaQuery(ProPersonnelStandMachine.class);
        return proPersonnelStandMachineMapper.selectList(query);
    }

    @Override
    public ProPersonnelStandMachine findById(Long id) {
        return proPersonnelStandMachineMapper.selectById(id);
    }

    @Override
    public boolean insert(ProPersonnelStandMachine proPersonnelStandMachine) {
        return save(proPersonnelStandMachine);
    }

    @Override
    public boolean update(ProPersonnelStandMachine proPersonnelStandMachine) {
        return updateById(proPersonnelStandMachine);
    }

    @Override
    public int delete(Long id) {
        return proPersonnelStandMachineMapper.deleteById(id);
    }

}